package com.gdgk.shop.service;


import com.gdgk.shop.bean.model.ScoreImportDetail;
import com.gdgk.shop.common.response.ServerResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface ScoreService {

    /**
     * 接收前端的excel
     * @param file
     * @return
     * @throws Exception
     */
    Long resolveExcel(MultipartFile file) throws Exception;


    /**
     * 提供给初次绑定手机号操作 绑定积分
     * @param mobileNumber
     * @param openId
     * @throws Exception
     */
    boolean bindingScoreByMobile(String mobileNumber, String openId) throws Exception;



    /**
     * 提供给支付操作
     * @param mobileNumber
     * @param score
     * @throws Exception
     */
    ServerResponseEntity subtractScoreByPay(String mobileNumber, Integer score) throws Exception;


    /**
     * 积分变更
     * @param detailList
     * @throws Exception
     */
    void pointsDistribution(List<ScoreImportDetail> detailList, Long recordId) throws Exception;


    /**
     * 根据手机号查询用户表的用户积分
     * @param mobileNumber
     * @throws Exception
     */
    int queryScoreByMobileNumber(String mobileNumber) throws Exception;

}
